package com.gosophia.roleManagement.action;

import java.net.URLEncoder;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.gosophia.commons.Page;
import com.gosophia.commons.web.action.BaseAjaxAction;
import com.gosophia.commons.web.action.BaseSupportAction;
import com.gosophia.commons.web.bean.RequestResult;
import com.gosophia.commons.web.logAnnotation.LogRecord;
import com.gosophia.userManagement.dto.RoleDTO;
import com.gosophia.userManagement.ws.UserManagementWebService;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

@Scope("prototype")
@Controller("EditRoleAction")
public class EditRoleAction extends BaseSupportAction{

	private RoleDTO role;
	
	@Autowired
	private UserManagementWebService userManagementWebService;

	@LogRecord(eventAction="角色管理-修改角色",eventTarget="role")
	@Override
	public String _execute() throws Exception {
		userManagementWebService.updateRole(role);
		super.getRequestResult().setRsltCode("0");
		super.getRequestResult().setMessage("修改角色成功");
		ActionContext.getContext().getSession().put("_lastOpResult", super.getRequestResult());
		return SUCCESS;
	}

	public void setRole(RoleDTO role) {
		this.role = role;
	}

	public RoleDTO getRole() {
		return role;
	}



}
